package com.soft.javase.ch04.interfaces.computer;

/**
 * @author wangzhisen
 * @Desc TODO
 * @date 2025/4/22
 */
public class Computer {

    private IStorage iStorage;

    public IStorage getiStorage() {
        return iStorage;
    }

    public void setiStorage(IStorage iStorage) {
        this.iStorage = iStorage;
    }

    public Computer(IStorage iStorage) {
            this.iStorage = iStorage;
        }

    public void readData(){
        System.out.println("读数据...");
        iStorage.read();
    }

    public void writeData(){
        System.out.println("写数据...");
        iStorage.write();
    }
}
